﻿using System.Linq.Expressions;

namespace S_Examine.Infrastructure
{
	public interface IRepository<T> where T : class, new()
	{
		Task<int> CreateAsync(T entity);

		Task<int> CreateAsyncRangeAsync(List<T> values);

		Task<int> UpdateAsync(T entity);

		Task<int> UpdateRangeAsync(List<T> values);

		Task<T> GetByIdAsync(int id);

		Task<T> GetByFuncAsync(Expression<Func<T, bool>> expre);

		Task<List<T>> GetAllAsync();

		Task<List<T>> GetAsync(Expression<Func<T, bool>> expre);

		Task<int> DeleteAsync(T entity);

		Task<int> BatchDeleteAsync(List<T> list);
	}
}
